Skip to content

[rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml#5817

Merged
iclanton merged 4 commits into
mainfrom
copilot/rush-51751-pnpm-1111-fix
Jun 7, 2026
Merged

[rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml#5817
iclanton merged 4 commits into
mainfrom
copilot/rush-51751-pnpm-1111-fix

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 4, 2026

pnpm 11 removed support for the pnpm field in package.json (including onlyBuiltDependencies/neverBuiltDependencies) and replaced it with allowBuilds: Record<string, boolean> in pnpm-workspace.yaml. Rush was still writing the old fields, causing [ERR_PNPM_IGNORED_BUILDS] on every install, and rush-pnpm approve-builds would run but never update any config files.

Changes

New globalAllowBuilds config field (pnpm 11+)

  • Added globalAllowBuilds?: Record<string, boolean> to pnpm-config.json schema and PnpmOptionsConfiguration
  • Written to allowBuilds in the generated pnpm-workspace.yaml during installation
  • true = package allowed to run build scripts; false = explicitly denied
// common/config/rush/pnpm-config.json
{
  "globalAllowBuilds": {
    "esbuild": true,
    "@parcel/watcher": true,
    "fsevents": false
  }
}

Backward compatibility

When using pnpm 11 with the old globalOnlyBuiltDependencies/globalNeverBuiltDependencies fields, Rush automatically converts them to allowBuilds format (entries become true/false respectively) and emits a deprecation warning directing users to migrate to globalAllowBuilds.

InstallHelpers.ts

For pnpm ≥ 11.0.0, skips writing neverBuiltDependencies/onlyBuiltDependencies to common/temp/package.json (pnpm 11 ignores the pnpm field entirely).

approve-builds command

For pnpm ≥ 11.0.0, rush-pnpm approve-builds now correctly reads the updated allowBuilds map from pnpm-workspace.yaml (written by pnpm approve-builds) and persists it back to pnpm-config.json as globalAllowBuilds, then re-runs rush update. Previously this was reading from package.json which pnpm 11 no longer updates.

Copilot AI changed the title [WIP] Fix compatibility issue between Rush 5.175.1 and pnpm 11.1.1 [rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml Jun 4, 2026
Copilot AI requested a review from iclanton June 4, 2026 01:18
@iclanton iclanton marked this pull request as ready for review June 6, 2026 22:34
@iclanton iclanton enabled auto-merge (squash) June 6, 2026 22:34
Comment thread libraries/rush-lib/src/logic/installManager/InstallHelpers.ts Outdated
Comment thread libraries/rush-lib/src/schemas/pnpm-config.schema.json
Comment thread libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts Outdated
@iclanton iclanton disabled auto-merge June 6, 2026 23:18
@iclanton
Copy link
Copy Markdown
Member

iclanton commented Jun 6, 2026

@copilot - take a look at the comments on the PR and respond and address them.

@iclanton iclanton enabled auto-merge (squash) June 6, 2026 23:47
@iclanton
Copy link
Copy Markdown
Member

iclanton commented Jun 7, 2026

@copilot - the build failed. The API report file needs to be updated.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 7, 2026

@copilot - the build failed. The API report file needs to be updated.

Fixed in the latest commit. Updated common/reviews/api/rush-lib.api.md to add globalAllowBuilds to _IPnpmOptionsJson, globalAllowBuilds as a readonly property to PnpmOptionsConfiguration, and the new updateGlobalAllowBuilds method.

@iclanton iclanton merged commit 7148e57 into main Jun 7, 2026
9 checks passed
@iclanton iclanton deleted the copilot/rush-51751-pnpm-1111-fix branch June 7, 2026 00:40
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

[rush] Rush 5.175.1 and pnpm 11.1.1 do not work together (build scripts issues)

3 participants